# -*- coding: utf-8 -*-
from django.db import models

# Create your models here.
class Renren(models.Model):
	gender = models.CharField(max_length=200)
	name = models.CharField(max_length=200)
	school = models.CharField(max_length=200)
	numberOfFriends = models.IntegerField(default=0)
	numberOfViews = models.IntegerField(default=0)
	url = models.CharField(max_length=200)
	renrenID = models.CharField(max_length=200,unique=True)
	image_urls = models.CharField(max_length=200)
	

	birthyear = models.IntegerField(default=0)
	birthmonth = models.IntegerField(default=0)
	birthday = models.IntegerField(default=0)
	hometown = models.CharField(max_length=200)
	department = models.CharField(max_length=200)
	constellation = models.CharField(max_length=200)
	face_rate = models.IntegerField(default=1000000)
	ranking = models.FloatField(default=0)
	def image_tag(self):
		return u'<img src="%s" width="200px" height="200px" />' % self.image_urls
	image_tag.short_description = 'Image'
	image_tag.allow_tags = True

	def url_tag(self):
		return u'<a href="%s">主页</a>' % self.url
	url_tag.short_description = 'url'
	url_tag.allow_tags = True
